﻿using System;
using System.ComponentModel;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Galaktika.BI.Charting
{
    [AttributeUsage(AttributeTargets.All)]
    public sealed class BrowsableAttribute : Attribute
    {
        // Fields
        private bool browsable = true;
        public static readonly BrowsableAttribute Default = Yes;
        public static readonly BrowsableAttribute No = new BrowsableAttribute(false);
        public static readonly BrowsableAttribute Yes = new BrowsableAttribute(true);

        // Methods
        public BrowsableAttribute(bool browsable)
        {
            this.browsable = browsable;
        }

        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return true;
            }
            BrowsableAttribute attribute = obj as BrowsableAttribute;
            return ((attribute != null) && (attribute.Browsable == this.browsable));
        }

        public override int GetHashCode()
        {
            return this.browsable.GetHashCode();
        }

        public bool IsDefaultAttribute()
        {
            return this.Equals(Default);
        }

        // Properties
        public bool Browsable
        {
            get
            {
                return this.browsable;
            }
        }
    }

    [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
    public interface IDataSeriesInfo
    {
        // Methods
        string[] GetDataNames();
        ValueCoordinate[] GetValueCoordinates();
        double[,] GetValues();
        void SetResolvedValues(int index, object[] values);

        // Properties
        object Connection { get; set; }
        string Label { get; set; }
        Binding[] MemberPaths { get; }
        object Symbol { get; set; }
    }

    internal interface ILayout
    {
        // Methods
        void UpdateLayout();
    }

    [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
    public interface IRenderer
    {
        // Events
        event EventHandler Changed;

        // Methods
        void AddSeries(IDataSeriesInfo seriesInfo);
        void Clear();

        // Properties
        ICoordConverter CoordConverter { get; set; }
        bool Dirty { get; set; }
        string Options { get; set; }
        UIElement Visual { get; set; }
    }

    [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
    public interface ICoordConverter
    {
        // Methods
        Point ConvertPoint(Point point);
        double ConvertX(double x);
        double ConvertY(double y);
        double ConvertZ(double z);

        // Properties
        Rect DataBounds { get; }
        Rect ViewBounds { get; }
    }

    public interface IModifiable
    {
        event ModifiedChangedEventHandler CollectionModified;

        void RaiseCollectionModified(ModifiedChangedEventArgs e);
    }

    public interface IAssemblyResources
    {
        string AssemblyName { get; set; }
    }
}
